<!DOCTYPE html>
<html>
<head>
    <#import "../common/common.macro.ftl" as netCommon>
    <@netCommon.commonStyle />
    <!-- DataTables -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
    <title>${I18n.admin_name}</title>
</head>
<body class="hold-transition skin-blue sidebar-mini <#if cookieMap?exists && cookieMap["xxljob_adminlte_settings"]?exists && "off" == cookieMap["xxljob_adminlte_settings"].value >sidebar-collapse</#if>">
<div class="wrapper">
    <!-- header -->
    <@netCommon.commonHeader />
    <!-- left -->
    <@netCommon.commonLeft "jobRepository" />

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>${I18n.job_repository_name}</h1>
        </section>

        <!-- Main content -->
        <section class="content">
<#--            <div class="col-xs-2">-->
<#--                <button class="btn btn-block btn-info" id="searchBtn">${I18n.system_search}</button>-->
<#--            </div>-->
            <div class="col-xs-1">
                <button class="btn btn-block btn-success add" type="button">${I18n.job_repository_btn_add}</button>
            </div>
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-body" >
                            <table id="job_repository_list" class="table table-bordered table-striped" width="100%" >
                                <thead>
                                <tr>
                                    <th name="id" >${I18n.strategy_id}</th>
                                    <th name="repName" >${I18n.job_repository_name}</th>
                                    <th name="repType" >${I18n.job_repository_type}</th>
                                    <th name="repBasePath" >${I18n.job_repository_path}</th>
                                    <th name="dbHost" >${I18n.job_repository_ip}</th>
                                    <th name="dbName" >${I18n.job_repository_dsName}</th>
                                    <th>${I18n.system_opt}</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                                <tfoot></tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <!-- 新增.模态框 -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog ">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" >${I18n.job_repository_add}</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form" role="form" >
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repName">资源库名称：<font color="red">*</font></label>
                            <div class="col-sm-7">
                                <input name="repName" type="text" placeholder="请输入资源库名称" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repType">资源库类型：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="repType" >
                                    <#list repTypeList as group>
                                        <option value="${group.code}" >${group.value}</option>
                                    </#list>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="createType">创建方式：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="createType" >
                                    <option value="1" >连接资源库</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repUsername">资源库用户名：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="repUsername" placeholder="请输入资源库用户名" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repPassword">资源库密码：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input type="password" name="repPassword" placeholder="请输入资源库密码" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbType">数据库类型：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="dbType" >
                                    <#list dbDtoList as group>
                                        <option value="${group.code}" >${group.value}</option>
                                    </#list>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbAccess">数据库访问模式：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="dbAccess" >
                                    <#list accessList as group>
                                        <option value="${group.code}" >${group.value}</option>
                                    </#list>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbHost">主机名或IP地址：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbHost" placeholder="请输入主机名或IP地址" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbPort">数据库端口号：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbPort" placeholder="请输入数据库端口号" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbName">数据库名称：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbName" placeholder="请输入数据库名称" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbUsername">数据库登录账号：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbUsername" placeholder="请输入数据库登录账号" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbPassword">数据库登录密码：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input type="password" name="dbPassword" placeholder="请输入数据库登录密码" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-6">
                                <button type="button" class="btn btn-primary test-conn-add"  >测试连接</button>
                                <button type="submit" class="btn btn-primary"  >${I18n.system_save}</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- 更新.模态框 -->
    <div class="modal fade" id="updateModal" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog ">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" >编辑资源库</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form" role="form" >
                        <input type="hidden" name="id" />
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repName">资源库名称：<font color="red">*</font></label>
                            <div class="col-sm-7">
                                <input name="repName" type="text" placeholder="请输入资源库名称" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <#--                        <input type="hidden" name="cron" />-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repType">资源库类型：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="repType" >
                                    <#list repTypeList as group>
                                        <option value="${group.code}" >${group.value}</option>
                                    </#list>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="createType">创建方式：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="createType" >
                                    <option value="1" >连接资源库</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repUsername">资源库用户名：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="repUsername" placeholder="请输入资源库用户名" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="repPassword">资源库密码：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input type="password" name="repPassword" placeholder="请输入资源库密码" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbType">数据库类型：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="dbType" >
                                    <#list dbDtoList as group>
                                        <option value="${group.code}" >${group.value}</option>
                                    </#list>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbAccess">数据库访问模式：<font color="red">*</font></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="dbAccess" >
                                    <#list accessList as group>
                                        <option value="${group.code}" >${group.value}</option>
                                    </#list>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbHost">主机名或IP地址：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbHost" placeholder="请输入主机名或IP地址" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbPort">数据库端口号：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbPort" placeholder="请输入数据库端口号" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbName">数据库名称：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbName" placeholder="请输入数据库名称" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbUsername">数据库登录账号：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input name="dbUsername" placeholder="请输入数据库登录账号" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label required" for="dbPassword">数据库登录密码：<font color="red">*</font></label>
                            <div class="col-sm-5">
                                <input type="password" name="dbPassword" placeholder="请输入数据库登录密码" class="form-control" aria-required="true">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-6">
                                <button type="button" class="btn btn-primary test-conn-update"  >测试连接</button>
                                <button type="submit" class="btn btn-primary"  >${I18n.system_save}</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- footer -->
    <@netCommon.commonFooter />
</div>

<@netCommon.commonScript />
<!-- DataTables -->
<script src="${request.contextPath}/static/adminlte/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="${request.contextPath}/static/adminlte/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- moment -->
<script src="${request.contextPath}/static/adminlte/bower_components/moment/moment.min.js"></script>
<#-- cronGen -->
<script src="${request.contextPath}/static/plugins/cronGen/cronGen<#if I18n.admin_i18n?default('')?length gt 0 >_${I18n.admin_i18n}</#if>.js"></script>
<#--<script src="${request.contextPath}/static/js/cron-generator/cronGen.js"></script>-->
<script src="${request.contextPath}/static/js/jobRepository.index.1.js"></script>
</body>
</html>
